<template>
  <div class="about">
    <div class="list">
        <movie-list v-for="item of subjects" :key="item.id" :item="item"></movie-list>
    </div>
  </div>
</template>
<script>
import MovieList from '../components/MovieList.vue';
export default {
  name:'coming',
  components:{
    MovieList
  },
  data(){
    return {
      subjects:[]
    }
  },
  async mounted(){
      if(localStorage.getItem('coming')){
        this.subjects = JSON.parse(localStorage.getItem('coming'));
      }else{
          let res = await this.axios.get("/movie/coming_soon");
          console.log(res);
          let str = JSON.stringify(res.data.subjects);
          localStorage.setItem("coming",str);
          this.subjects = res.data.subjects;
      }
  }
}
</script>
